package com.book.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/user")
public class userePageController {

    @RequestMapping("/siteorder")
    public String tositeorder(HttpSession session) {
        if (session.getAttribute("student")==null) {
            session.setAttribute("msg","用户未登录，请重新登录！");
            return "userlogin.html";
        } else {
            return "siteorder.html";
        }
    }


    @RequestMapping("/noticemanage")
    public String tobookManage( HttpSession session) {
        if (session.getAttribute("student")==null) {
            session.setAttribute("msg","用户未登录，请重新登录！");
            return "userlogin.html";
        } else {
            return "notice.html";
        }
    }

    @RequestMapping("/ordermanage")
    public String toordermange(HttpSession session) {
        if (session.getAttribute("student") == null) {
            session.setAttribute("msg","用户未登录，请重新登录！");
            return "userLogin.html";
        } else {
            return "ordermanage.html";
        }
    }

    @RequestMapping("/fix")
    public String tofix(HttpSession session) {
        if (session.getAttribute("student") == null) {
            session.setAttribute("msg","用户未登录，请重新登录！");
            return "userLogin.html";
        } else {
            return "fix.html";
        }
    }
//    @RequestMapping("/readerManage")
//    public String toreaderManage(HttpSession session) {
//        if (session.getAttribute("admin") == null) {
//            return "adminLogin.html";
//        } else {
//            return "readerManage.html";
//        }
//
//    }
//
//
//    @RequestMapping("/borrowSearch")
//    public String toborrowSearch(HttpSession session) {
//        if (session.getAttribute("admin") == null) {
//            return "adminLogin.html";
//        } else {
//            return "borrowSearch.html";
//        }
//
//    }
//
//    @RequestMapping("/home")
//    public String tohome(HttpSession session) {
//        if (session.getAttribute("admin") == null) {
//            return "adminLogin.html";
//        } else {
//            return "admin.html";
//        }
//
//    }
}
